<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
	<meta charset="UTF-8">
	<title>D_civilization_practice</title>
	<meta name="page-view-size" content="1280*720">
	<link rel="stylesheet" href="css/base.css">
	<link rel="stylesheet" href="css/D_civilization_practice.css">
	<script type="text/javascript" src="lib/js/evm.js"></script>
	<script type="text/javascript" src="lib/js/Evm_djyw.js"></script>
	<script type="text/javascript" src="lib/js/key.js"></script>
	<script src="lib/js/md5.js" type="text/javascript" charset="utf-8"></script>
	<script src="lib/js/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="lib/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/api.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/public.js" type="text/javascript" charset="utf-8"></script>
	<style>
		.theoretical-bg>div:nth-child(8) {
			width: 255px;
			height: 122px;
			position: absolute;
			left: 61px;
			top: 461px;
			border-radius: 10px;
		}

		.theoretical-bg>div:nth-child(9) {
			width: 255px;
			height: 122px;
			position: absolute;
			left: 335px;
			top: 461px;
			border-radius: 10px;
		}

		.theoretical-bg>div:nth-child(10) {
			display: none;
		}

		.theoretical-bg>div:nth-child(6) {
			top: 153px;
			left: 605px;
			width: 616px;
			height: 431px;
			min-height: 36px;
			text-align: left;
			/* transform: translate(-50%, -50%); */
		}

		.model:nth-child(4) {
			display: block;
			width: 100px;
			height: 35px;
			position: absolute;
			top: 450px;
			left: 170px;
			text-align: center;
			background: url(../images/like-1.png) no-repeat;
			background-position: top center;
			background-size: 60px 60px;
			padding-top: 80px;
			font-size: 15px;
			color: #fff;
		}

		.theoretical-bg>div:nth-child(7) {
			width: 449px;
			height: 205px;
			position: absolute;
			left: 58.3%;
			top: 341px;
			border: 3px solid #ccc;
			z-index: 888;
		}

		.item>div {
			margin-top: 25px;
		}
	</style>
</head>

<body>
	<div class="theoretical-bg" id="theoreticalMain">
		<div id="white-bg"></div>
		<div id="blue-bg"></div>
		<div class="model">
			<img class="addimg" src="" width="100%" height="100%" alt="">
		</div>
		<div class="status"><img src="images/status1.png" alt=""></div>
		<div class="info">
			<div class="title"></div>
		</div>
		<div class="item">
			<!-- <div class="baotime"></div> -->
			<div class="contacts">

			</div>
			<div class="phone">

			</div>
			<div class="address">

			</div>
			<!-- <div class="situation"></div> -->
			<!-- <div class="contacts"></div> -->
			<div>
				<div class="orange">基本概况:</div>
			</div>
		</div>
		<div class="model position">
			<div class="container" id="container">
				<div class="content" id="content">

				</div>
			</div>
		</div>
		<!-- <div class="bm_border">
			<div><img class="erweima" src="" alt=""></div>
			<div>微信扫码报名</div>
		</div> -->

		<div class="model">
			<img src="images/dynamic.png" alt="">
		</div>
		<div class="model">
			<img src="images/positions.png" alt="">
		</div>
		<!-- <div class="model">
			<img src="images/positions.png" alt="">
		</div>
		<div class="model">
			<img src="images/resources.png" alt="">
		</div> -->

	</div>
</body>
<script>
	var modelIndex = {
		disUser: false,
		specialState: 'didi',
		index: 2, //初始位置
		listName: 'model', //模块名称
		containerId: 'theoreticalMain', //包含模块的标签id
		thisContain: 'container', //翻滚外容器
		thisDetail: 'content', //翻滚内容
	}
	var articleRun;
	var data = [{
			name: "视频窗口",
			url: "play.html",
			model: 'play'
		},
		{

		},
		{
			name: "动态",
			cid: "55",
			url: "suozhan_SingleList.html",
			model: 'article'
		},

		{
			name: "实践阵地",
			url: " suozhan_SingleList.html",
			model: "sjz"
		},
		{
			name: "阵地",
			url: "suozhan_SingleList.html",
			model: "sjz",
		},
		{
			// name: "资源",
			// url: "A_SingleList.html",
			// model: "play",
		}
	];

	function getMessage() {
		var param = {
			id: TV.GetParam('area_id'),
			area_id: TV.GetParam('area_id'),
			// access_token: $.cookie("TV_CST_TOKEN"),

		}
		GetDatas('childInfo', param, function (err, res) {
			mess = res.data;
			$('.title').html(mess.title);
			$('.endtime').html(" <div class=orange>结束时间</div>: " + mess.format_end_time);
			$('.starttime').html(" <div class=orange>活动时间</div>: " + mess.format_start_time + ' 至 ' + mess
				.format_end_time);
			$('.organization').html('<div class=orange>发起组织</div>：' + mess.group_name)
			$('.address').html('<div class=orange>地&nbsp;&nbsp;&nbsp;&nbsp &nbsp; 址:</div>' +
				'&nbsp;&nbsp;&nbsp;&nbsp;' + mess.name);
			$('.serviceTime').html('<div class=orange>服务时长</div>：' + mess.service_time);
			$('.phone').html('<div class=orange>联系电话:</div>' + '&nbsp;&nbsp;&nbsp;&nbsp;' + mess.contacter);
			$('.contacts').html('<div class=orange>联 系 &nbsp;人:</div>' + '&nbsp&nbsp;&nbsp;&nbsp;&nbsp;' + mess
				.master);
			$(".addimg").attr("src", mess.img ? API_URL.imgURL + mess.img : "/images/nonePic.png")



			$('.content').html(mess.content);
			$('.imgs').attr('src', API_URL.imgURL + mess.images);
			// $('.').html(mess.);
			var surl = API_URL.loginURL + "home/index/qrcode?url=" + encodeURIComponent(
				API_URL.activityUrl + '/' + TV.GetParam('id'))
			$('.erweima').attr('src', surl)
		})
		// right.toggleFocus();
	}

	getMessage();

	function direOpt(index, directive) {
		if (directive == "up") { //上
			switch (index) {
				case 0:
					index = index;
					break;
				case 2:
				case 3:
					index = 0;
					break;
				case 4:
				case 5:
					index = 1;
					break;
			}
			console.log('toptop')

			if (index == 1) { //文章翻滚
				TV.articleMove(directive, modelIndex.thisContain, modelIndex.thisDetail);
			}
		} else if (directive == "down") { //下
			console.log('downdown', index)
			switch (index) {
				case 0:
					index = 2;
					break;
				case 2:
				case 3:
				case 4:
				case 5:
					index = index;
					break;
			}
			if (index == 1) { //文章翻滚
				console.log(directive, modelIndex.thisContain, modelIndex.thisDetail, '21212')
				TV.articleMove(directive, modelIndex.thisContain, modelIndex.thisDetail);
			}
		} else if (directive == "backwards") { //左
			clearInterval(articleRun)

			switch (index) {
				case 0:
					index = index;
					break;
				case 1:
					index = 3;
					break;
				
				case 2:
				case 3:
				case 4:
				case 5:
					index--;
					break;
			}

		} else if (directive == "forwards") {
			clearInterval(articleRun)

			switch (index) {
				case 0:
				case 1:
				case 2:
					index++;
					break;
				case 3:
					index = 1;
					break;
				case 5:
					index = index;
					break;
			}
		}
		console.log(index)
		return index;
	}

	function direEnter(index) {
		console.log(index)
		if (index == 0) {

		}
		//  else if (index == 4) {
		// 	window.location.href = data[index].url + '?titles=实践站&model=childArealistindo' +
		// 		'&area_id=' + TV.GetParam('area_id')
		// } else {
		// 	//window.location.href = 'A_SingleList.html?id=' + TV.GetParam('id') + '&type=activity';
		// 	window.location.href = data[index].url + '?titles=' + data[index].name + '&model=' + data[index].model +
		// 		'&area_id=' + TV.GetParam('area_id')
		// }
		if (index == 2 ||index == 3) {
			window.location.href = data[index].url + '?titles=' + data[index].name + '&model=' + data[index].model +
				'&area_id=' + TV.GetParam('area_id')
		} 
		// else if (index == 3) {
		// 	TV.PromptMsg('敬请期待');
		// }
		// if (index >= 2 && index < 5) {
		// 	//window.location.href = 'A_SingleList.html?id=' + TV.GetParam('id') + '&type=activity';
		// 	window.location.href = data[index].url + '?titles=' + data[index].name + '&model=' + data[index].model +
		// 		'&area_id=' + TV.GetParam('area_id')
		// }
	}

	function resOpt(res) {
		// console.log(res)
		if (res.code == 0) {
			if (mess.status == 2) {
				TV.PromptMsg('点赞成功');
				var param = {
					id: TV.GetParam('id'),
					area_id: $.cookie('TV_CST_AREA')
				}
				GetDatas('getActivity', param, function (err, res) {
					mess = res.data;

					$("#like").html("点赞:" + mess.likes)
				})
			} else {
				getMessage()
				TV.PromptMsg('已成功，请耐心等待')
				setTimeout(function () {
					window.history.go(-1)
				}, 2000);
			}

		} else if (res.code == 10002) {
			TV.userLogin();
			direEnter(index);
		} else {
			TV.PromptMsg(res.message)
		}
	}
</script>
<script type="text/javascript" src="js/index.js"></script>

</html>